package handler

import (
	"github.com/go-xorm/xorm"
	"github.com/mojocn/base64Captcha"
	"note/service/repository"
	"note/service/repository/mysql"
)

var (
	//验证码
	Base64CaptchaConfigDigit = base64Captcha.ConfigDigit{
		Height:     80,
		Width:      240,
		MaxSkew:    0.7,
		DotCount:   80,
		CaptchaLen: 5,
	}

	//数据库
	districtsRepository  repository.DistrictsRepository
	ordersRepository     repository.OrdersRepository
	schoolsRepository    repository.SchoolsRepository
	goodsOrderRepository repository.GoodsOrderRepository
)

func InitDao(db *xorm.Engine) {
	districtsRepository = mysql.NewDistrictsRepository(db)
	ordersRepository = mysql.NewOrdersRepository(db)
	schoolsRepository = mysql.NewSchoolRepository(db)
	goodsOrderRepository = mysql.NewGoodsOrderRepository(db)
}
